#!/bin/bash
# preinst script for system-test-libctest
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <new-preinst> \`install'
#        * <new-preinst> \`install' <old-version>
#        * <new-preinst> \`upgrade' <old-version>
#        * <old-preinst> \`abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    install|upgrade)
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/assert_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/ctype_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/dirent_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/fcntl_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/locale_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/math_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/netdb_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/pthread_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/signal_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/socket_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/stdalign_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/stddef_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/stdio_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/stdlib_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/stdnoreturn_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/string_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/strings_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/sys_atomic_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/sys_mman_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/sys_stat_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/sys_time_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/sys_timeb_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/threads_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/time_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/ucontext_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/unistd_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/wchar_h
	rm -f $BASEDIR/opt/libc-tests/tests/symbols/wctype_h
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

